<?php

namespace Model\Events;

/**
 * Model which contains the filters and validators for forms of events
 */
class filterInput
{
    /**
     * Filter input for addNewEvent
     * 
     * @return stdClass attributes: filters, validators
     */
    public function addNewEvent()
    {
        $result = new \stdClass();
        
        $result->filters =
        array('*' => 'StripTags');
        
        $result->validators =
        array(
            'name'      => array(
                            array('Regex', array('pattern' => '/^[a-z0-9-_ ]+$/i')),
                            array('StringLength', 4, 64)),
            'type'      => array(
                            array('Regex', array('pattern' => '/^[1-6]{1,1}$/'))),
            'timeStart' => array(
                            array('Date')),
            'timeEnd' => array(
                            array('Date'))
            );
        
        return $result;
    }
}

# eof